﻿using System.Windows.Forms;
using GeoSketch2.Core;

namespace GeoSketch2.Archaeo
{
    public partial class TBBPolylineClose : BaseToolbarButton
    {
        #region Constructor
        /// <summary>
        /// The toolbar button for the polyline closing tool
        /// </summary>
        public TBBPolylineClose()
        {
            InitializeComponent();
            ToolTipText = "Close Polyline";
        } 
        #endregion

        #region Events
        /// <summary>
        /// The event on the mouse click on the button
        /// </summary>
        protected override void OnMouseClick(object sender, MouseEventArgs e)
        {
            ((TBPolyline)this.Parent).CurrentTool.ClosePolyline();

            ((TBPolyline)this.Parent).CurrentTool.RefreshViewport();
        }
        #endregion
    }
}
